Persons and relations between them can be modeled as graphs, where nodes represent persons and connections or edges between the nodes represent relations between the persons. These graphs are sometimes called social networks. Social networks have been stored in relational databases. Various structured query languages (SQLs) and dialects thereof are used to express requests to search relational databases. However, the present inventors have observed that SQL-like query languages are not well suited to expressing the information desired to be obtained from social networks. There is a need for a data model and language to allow intuitive expression of requests to search social networks.